<!doctype html>
<html>

<head>
    <title>微品致远传送门</title>
    <meta content="微品致远传送门" name="description">
    <meta content="微品致远传送门" name="keywords">
    <!-- inject:meta -->
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <meta charset="utf-8">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Set render engine for 360 browser -->
    <meta content="webkit" name="renderer">
    <!-- No Baidu Siteapp-->
    <meta content="no-siteapp" http-equiv="Cache-Control"/>
    <link href="http://at.alicdn.com/t/font_p27hnfue2k18xgvi.css" rel="stylesheet" type="text/css">
    <link href="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/css/bootstrap.min.css" rel="stylesheet"
          type="text/css">
    <link href="/mgn/static/css/main.css" rel="stylesheet" type="text/css"/>
    <!--js-->
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/5.1.1/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<!--头部-->
<div class="header" style="height:110px;background:#ffffff">
    <div class="header-box clearfix" style="margin-left:30px">
        <a href="#"><img alt="" class="logo" src="/mgn/static/images/637727698783507431.png"></a>
        <div class="header-nav" style="margin-top:40px">
            <nav class="navbar navbar-expand-sm justify-content-center">
                <ul class="navbar-nav">
                    <li class="nav-item" data-name="index"><a
                            href="http://transdoor.vpclub.cn/api/trans">微品传送门数据配置</a></li>
                    <li class="nav-item" data-name="preview"><a
                            href="http://transdoor.vpclub.cn/api/trans/preview">数据预览</a></li>
                    <li class="nav-item" data-name="fetch"><a
                            href="http://transdoor.vpclub.cn/api/trans/fetch/">项目列表</a></li>
                    <li class="nav-item" data-name="rel"><a
                            href="http://transdoor.vpclub.cn/api/trans/rel/">项目类目关联配置</a></li>
                    <li class="nav-item" data-name="catalog"><a href="http://transdoor.vpclub.cn/api/trans/catalog/">项目分类列表</a>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
</div>
<script type="text/javascript">
	$(function () {
		var name = '/' + location.pathname.split('/')[1];
		$('.header-nav').find('li[data-name="' + name + '"]').addClass('active');
		$("#btnCatalogAdd").bind('click',function(){ clearData('catalog') });
	});



</script>
<!-- endinject -->

<!-- bodyer -->
<div class="bodyer">
    <div class="main-introduce main-module">
        <div class="widget widget-tabs" style="margin-top:70px;">
            <h3>项目分类列表</h3><br/>
            <div class="container-fluid">
                <div class="row" id="errDiv" style="display:none">
                    <input id="errMsg" name="errMsg" type="hidden" value="{{errMsg}}">
                    <div class="col-sm-12">
                        <div class="alert alert-danger alert-dismissible fade show">
                            <button class="close" data-bs-dismiss="alert" type="button">&times;</button>
                            <strong>错误!</strong> 你应该认真阅读 <br/><a class="alert-link" href="#">{{errMsg}}</a>。
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-sm-3"></div>
                    <div class="col-sm-6 " style="text-align:center;padding: 5px 5px 5px 5px">
                        <form action="/api/trans/catalog/" id="scheduSearchForm" method="GET">
                            <div class="input-group">
                                <div class="input-group-prepend">
                                    <span class="input-group-text">项目名称</span>
                                </div>
                                <input class="form-control" id="input_catalog" name="jobName" style="width:70px"
                                       type="text"/>
                                <div class="btn-group">
                                    <button class="btn btn-primary" id="btnCatalogFetch" type="submit">查询</button>
                                    <!-- 按钮：用于打开模态框 -->
                                    <button class="btn btn-danger" data-bs-target="#myModal" data-bs-toggle="modal"
                                            id="btnCatalogAdd" type="button">创建分类
                                    </button>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="col-sm-3"></div>
                </div>
                <div class="row">
                    <div class="col-sm-12" style="height:550px;overflow-y:scroll;">
                        <table class="table table-striped table-bordered table-hover">
                            <thead>
                            <tr>
                                <th width="120px">目录ICON</th>
                                <th width="20%">上级目录名称</th>
                                <th width="18%">目录编号</th>
                                <th>目录名称</th>
                                <th width="150px">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            % for data in data_list['lists']:
                            <tr>
                                <td>
                                    <image src="{{data['catalog_logo']}}" style="width:40px;height:40px"/>
                                </td>
                                <td style="text-align:left">{{data['pname']}}</td>
                                <td style="text-align:left">{{data['catalog_sno']}}</td>
                                <td style="text-align:left">{{data['catalog_name']}}</td>
                                <td>
                                    <input id="dataid" name="dataid" type="hidden" value="{{data['id']}}"/>
                                    <input id="datapsno" name="datapsno" type="hidden" value="{{data['psno']}}"/>
                                    <button class="btn btn-outline-info btn-sm" data-bs-target="#myModal"
                                            data-bs-toggle="modal"
                                            onclick="changeCatalog({{data['id']}})"
                                            type="button">编辑
                                    </button>
                                    <button class="btn btn-outline-danger btn-sm" onclick="delCatalog({{data['id']}})"
                                            type="button">删除
                                    </button>
                                </td>
                            </tr>
                            % end
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- inject:footer -->
    <!--底部-->
    <div class="footer">
        <div class="footer-inner">
            <div class="links">
                <div class="copyright">
                    Copyright © 2023 版权所有
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 模态框 -->
<div class="modal fade" id="myModal">
    <div class="modal-dialog">
        <form action="/api/trans/catalog/add/" id="catalogForm" method="post">
            <div class="modal-content">
                <!-- 模态框头部 -->
                <div class="modal-header">
                    <h4 class="modal-title">项目信息</h4>
                    <button class="close" data-bs-dismiss="modal" type="button">&times;</button>
                </div>
                <!-- 模态框主体 -->
                <div class="modal-body">
                    <div style="padding: 15px 15px 15px 15px">
                        <div class="input-group mb-4">
                            <div class="input-group-prepend">
                                <span class="input-group-text">数据ID</span>
                            </div>
                            <input class="form-control" id="input_id" name="id" type="text"/>
                        </div>
                        <div class="input-group mb-4">
                            <div class="input-group-prepend">
                                <span class="input-group-text">上级目录编号</span>
                            </div>
                            <input class="form-control" id="psno" name="psno" type="text"/>
                        </div>
                        <div class="input-group mb-4">
                            <div class="input-group-prepend">
                                <span class="input-group-text">目录编号</span>
                            </div>
                            <input class="form-control" id="catalogSno" name="catalogSno" type="text"/>
                        </div>
                        <div class="input-group mb-4">
                            <div class="input-group-prepend">
                                <span class="input-group-text">目录ICON</span>
                            </div>
                            <input class="form-control" id="catalogLogo" name="catalogLogo" type="text"/>
                        </div>
                        <div class="input-group mb-4">
                            <div class="input-group-prepend">
                                <span class="input-group-text">目录名称</span>
                            </div>
                            <input class="form-control" id="catalogName" name="catalogName" type="text"/>
                        </div>
                        <div class="input-group mb-4">
                            <div class="input-group-prepend">
                                <span class="input-group-text">排序</span>
                            </div>
                            <select class="form-control" id="sortkey" name="sortkey">
                                <option value="-1">请选择</option>
                                % for sort in range(1,10):
                                <option value="{{sort}}">{{sort}}</option>
                                % end
                            </select>
                        </div>
                        <div class="input-group mb-4">
                            <div class="input-group-prepend">
                                <span class="input-group-text">可见性</span>
                            </div>
                            <select class="form-control" id="viewKey" name="viewKey">
                                <option value="-1">请选择</option>
                                <option value="1">可见</option>
                                <option value="0">不可见</option>
                            </select>
                        </div>
                    </div>
                </div>
                <!-- 模态框底部 -->
                <div class="modal-footer">
                    <button class="btn btn-primary" type="submit">提交数据</button>
                    <button class="btn btn-secondary" onclick="editCatalog()" type="button">保存数据</button>
                    <button class="btn btn-danger" data-bs-dismiss="modal" type="button">关闭</button>
                </div>
            </div>
        </form>
    </div>
</div>
<!-- endinject -->
<script src="/mgn/static/plugin/vpTrans.js"></script>
<script src="/mgn/static/plugin/catalog.js"></script>
<script src="/mgn/static/plugin/trans.js"></script>
<style>.copyrights{text-indent:-9999px;height:0;line-height:0;font-size:0;overflow:hidden;}</style>
</body>
</html>